import { createStore } from 'vuex'

export default createStore({
  state: {
    userinfo: {},
    routes: []
  },
  mutations: {
    initRoutes (state, data) {
      state.routes = data
    },
    setUserInfo (state,user) {
      state.userinfo = user
      window.sessionStorage.setItem('user', JSON.stringify(user))
    }
  },
  actions: {},
  modules: {}
})
